<form lay-filter="purchaseSignTaskForm" class="layui-form open-form">
  <div class="open-model" id="warehouseStorageRecordFormByAdd">
    <div class="open-auto">
      <input name="id" type="hidden" />
      <div class="layui-col-xs3">
        <div class="layui-form-item">
          <label class="layui-form-label" style="width: 100px">入库类型</label>
          <input type="text" name="signCode" id="productInventoryType" id="productInventoryType" hidden />
          <div class="layui-input-block" style="margin-left: 130px">
            <select id="inventoryTypeId" name="inventoryTypeId" lay-filter="inventoryTypeId" lay-search lay-verify="required"></select>
          </div>
        </div>
      </div>
      <div class="layui-col-xs3">
        <div class="layui-form-item">
          <label class="layui-form-label" style="width: 100px">捆包码</label>
<!--          <input type="text" name="signCode" id="signCode" hidden />-->
          <div class="layui-input-block" style="margin-left: 130px">
            <select id="userBundleCode" name="userBundleCode" lay-filter="userBundleCode" lay-search lay-verify="required"></select>
          </div>
        </div>
      </div>
<!--      <div class="layui-col-xs3">-->
<!--        <div class="layui-form-item">-->
<!--          <label class="layui-form-label" style="width: 100px">产品SKU编号</label>-->
<!--          <input type="text" name="warehouseProductName" id="warehouseProductName" hidden />-->
<!--          <div class="layui-input-block" style="margin-left: 130px">-->
<!--            <div id="standardSku" style="display: flex; align-items: center">-->
<!--              <select id="warehouseProductId" name="warehouseProductId" lay-filter="warehouseProductId" lay-search></select>-->
<!--            </div>-->
<!--          </div>-->
<!--        </div>-->
<!--      </div>-->

      <div class="layui-col-xs3">
        <div class="layui-form-item">
          <label class="layui-form-label" style="width: 100px">所属客户</label>
          <input type="text" name="customerId" id="customerId" hidden />
          <div class="layui-input-block" style="margin-left: 130px">
            <input type="text" name="customerName" id="customerName" class="layui-input" disabled />
          </div>
        </div>
      </div>
      <div class="layui-col-xs3">
        <div class="layui-form-item">
          <label class="layui-form-label" style="width: 100px">签收记录单</label>
          <input type="text" name="warehouseOrderId" id="warehouseOrderId" hidden />
          <div class="layui-input-block" style="margin-left: 130px">
            <input type="text" name="signCode" id="signCode" class="layui-input" disabled />
          </div>
        </div>
      </div>
      <div class="layui-col-xs3">
        <div class="layui-form-item">
          <label class="layui-form-label" style="width: 100px">所属运单号</label>
          <div class="layui-input-block" style="margin-left: 130px">
            <input type="text" name="waybill" id="waybill" class="layui-input" disabled />
          </div>
        </div>
      </div>
      <div class="layui-col-xs3">
        <div class="layui-form-item">
          <label class="layui-form-label" style="width: 100px">所属托管合同</label>
          <div class="layui-input-block" style="margin-left: 130px">
            <input type="text" name="contractCode" id="contractCode" class="layui-input" disabled />
          </div>
        </div>
      </div>
      <div class="layui-col-xs3">
        <div class="layui-form-item">
          <label class="layui-form-label" style="width: 100px">规格号</label>
          <div class="layui-input-block" style="margin-left: 130px">
            <input type="text" name="specifications" id="specifications" class="layui-input" disabled />
          </div>
        </div>
      </div>

      <div class="layui-col-xs3">
        <div class="layui-form-item">
          <label class="layui-form-label" style="width: 100px">产地/厂家</label>
          <div class="layui-input-block" style="margin-left: 130px">
            <input type="text" name="productProducer" id="productProducer" class="layui-input" disabled />
          </div>
        </div>
      </div>
      <div class="layui-col-xs3">
        <div class="layui-form-item">
          <label class="layui-form-label" style="width: 100px">品种</label>
          <div class="layui-input-block" style="margin-left: 130px">
            <input type="text" name="productVariety" id="productVariety" class="layui-input" disabled />
          </div>
        </div>
      </div>
      <div class="layui-col-xs3">
        <div class="layui-form-item">
          <label class="layui-form-label" style="width: 100px">钢种/牌号</label>
          <div class="layui-input-block" style="margin-left: 130px">
            <input type="text" name="productMark" id="productMark" class="layui-input" disabled lay-verify="required" />
          </div>
        </div>
      </div>
      <div class="layui-col-xs3">
        <div class="layui-form-item">
          <label class="layui-form-label" style="width: 100px">入库仓库</label>
          <input type="text" name="warehouseFactoryAdministrationName" id="warehouseFactoryAdministrationName" hidden />
          <div class="layui-input-block" style="margin-left: 130px">
            <select
              id="warehouseFactoryAdministrationId"
              name="warehouseFactoryAdministrationId"
              lay-filter="warehouseFactoryAdministrationId"
              lay-search
              lay-verify="required"></select>
          </div>
        </div>
      </div>
      
<!--      <div class="layui-col-xs3">-->
<!--        <div class="layui-form-item">-->
<!--          <label class="layui-form-label" style="width: 100px">已有库存</label>-->
<!--          <div class="layui-input-block" style="margin-left: 130px">-->
<!--            <input type="text" name="inventorySum" id="inventorySum" class="layui-input" disabled />-->
<!--          </div>-->
<!--        </div>-->
<!--      </div>-->
      <div class="layui-form-item">
        <div>
          <div class="layui-btn" id="addProduct" style="margin-top: 10px">新增库区</div>
          <div id="productList">
            <table class="layui-table" id="warehousePurchaseSignTaskProductTable" lay-filter="warehousePurchaseSignTaskProductTable"></table>
          </div>
        </div>
      </div>

      <!--        <div class="open-details-title" style="margin-bottom: 5px;">库位信息</div>-->
      <!--        {{# if(d.eventName!="detail"){ }}-->
      <!--        <button class="layui-btn" id="addTableData" style="margin-top: 15px;">添加库位</button>-->
      <!--        {{# } }}-->
    </div>
    <div class="layui-form-item text-right">
      <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button>
      <button class="layui-btn" lay-filter="warehouseEntryTaskAdd" type="button" lay-submit>提交</button>
    </div>
  </div>
</form>
<script type="text/html" id="PurchaseSignTaskProductTableClick">
<!--  <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="edit">入库作业</a>-->
  <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete">删除</a>
</script>

<!--库区内容-->
<script type="text/html" id="purchaseStoragelocation">
  <form lay-filter="warehouseFormContent" id="warehouseFormContent" class="layui-form open-form">
    <div class="open-model">
      <div class="open-auto">
        <div>
          <table class="layui-table">
            <thead>
            <tr>
              <th lay-data="{field:'shipmentOrderCode', width:150, sort: true, fixed: 'left'}">
                仓库编号
              </th>
              <th lay-data="{field:'shipmentOrderCode', width:150, sort: true, fixed: 'left'}">
                仓库名称
              </th>
              <th lay-data="{field:'materialName', width:150, sort: true, fixed: 'left'}">仓库类型
              </th>
              <th lay-data="{field:'materialSpec', width:150, sort: true, fixed: 'left'}">仓库属性</th>
              <th lay-data="{field:'materialUnit', width:150, sort: true, fixed: 'left'}">性质</th>
              <th lay-data="{field:'materialSpec', width:150, sort: true, fixed: 'left'}">
                出入库方式
              </th>
              <th lay-data="{field:'materialSpec', width:150, sort: true, fixed: 'left'}">责任部门</th>
              <th lay-data="{field:'materialSpec', width:150, sort: true, fixed: 'left'}">
                地址
              </th>
              <th lay-data="{field:'materialSpec', width:150, sort: true, fixed: 'left'}">状态</th>
              <th lay-data="{field:'materialUnit', width:150, sort: true, fixed: 'left'}">创建时间</th>
              <th lay-data="{field:'materialUnit', width:150, sort: true, fixed: 'left'}">创建人	</th>
<!--              <th lay-data="{field:'materialUnit', width:150, sort: true, fixed: 'left'}">描述</th>-->
            </tr>
            </thead>
            <tbody>
            <tr>
              <td>
                <input class="layui-input adv-disable" id="code" disabled
                       name="code"/>
              </td>
              <td>
                <input type="text" class="layui-input" disabled id="name"
                       name="name"/>
              </td>
              <td>
                <input type="text" class="layui-input" disabled id="warehouseTypeName"
                       name="warehouseTypeName"/>
              </td>
              <td>
                <input class="layui-input adv-disable" id="warehouseAttrName" disabled
                       name="warehouseAttrName"/>
              </td>
              <td>
                <input class="layui-input adv-disable" id="warehouseFeatureTypeDesc" disabled
                       name="warehouseFeatureTypeDesc"/>
              </td>
              <td>
                <input class="layui-input adv-disable" id="warehouseInoutNatureName" disabled
                       name="warehouseInoutNatureName"/>
              </td>

              <td>
                <input type="text" class="layui-input" disabled name="departmentName"/>
              </td>

              <td>
                <input type="text" class="layui-input" disabled name="addr"/>
              </td>
              <td>
                <input type="text" class="layui-input" disabled name="statusDesc"/>
              </td>
              <td>
                <input type="text" class="layui-input" disabled name="createTime"/>
              </td>
              <td>
                <input class="layui-input adv-disable" id="createTime" disabled name="modifierName"/>
              </td>
<!--              <td>-->
<!--                <input class="layui-input adv-disable" id="creatorName" disabled-->
<!--                       name="creatorName"/>-->
<!--              </td>-->
            </tr>
            </tbody>
          </table>
        </div>
        <!--      <div class="layui-form-item tableContent">-->
        <!--        <table class="layui-table" id="signFormtable" lay-filter="signFormtable"></table>-->
        <!--      </div>-->
        <div class="layui-form-item tableContent" id="">
          <button class="layui-btn layui-btn-normal icon-btn" type="button" id="confirmChoose">确认选择</button>
          <table class="layui-table" id="purchaseSignTaskProductListTable" lay-filter="purchaseSignTaskProductListTable"></table>
        </div>
<!--        <div class="layui-fluid">-->
<!--          <div class="layui-card">-->
<!--            <div class="layui-card-body">-->
<!--              &lt;!&ndash; 头部操作栏 &ndash;&gt;-->
<!--              <div class="layui-form lay-header">-->
<!--                <div class="toolbar">-->
<!--                  <div class="layui-form-item lay-query-content">-->
<!--                    <div class="lay-query-box">-->
<!--                      <div class="query-lt">-->
<!--                        <div class="layui-inline">-->
<!--                          <button class="layui-btn layui-btn-normal icon-btn" id="confirmChoose">确认选择</button>-->
<!--                        </div>-->
<!--                      </div>-->
<!--                      <div class="query-rt"></div>-->
<!--                    </div>-->
<!--                  </div>-->
<!--                </div>-->
<!--              </div>-->
<!--              &lt;!&ndash; 表格 &ndash;&gt;-->
<!--              <table class="layui-table" id="purchaseSignTaskProductListTable" lay-filter="purchaseSignTaskProductListTable"></table>-->
<!--            </div>-->
<!--          </div>-->
<!--        </div>-->
      </div>

    </div>
  </form>
</script>
<script>
  layui.use(["form", "table", "laydate", "layedit", "laydate"], async function () {
    $ = layui.jquery;
    var form = layui.form;
    var admin = layui.admin;
    var table = layui.table;
    var upload = layui.upload;
    var config = layui.config;
    var laytpl = layui.laytpl;
    var warehouseAreaList = [];
    var formData={}
    var deliveryRecordProductList = [];
    var warehouseProductInventoryVoList = [];
    var warehouseFactoryAdministrationName='';
    var warehouseFeatureTypeDesc='';
    var warehouseTypeId='';
    let warehouseShelfId=''
    // admin.req(
    //   "warehouse/warehouse/admin/warehouseFactoryArea/list",
    //   {
    //     warehouseId: 1559867214498267137
    //   },
    //   (res) => {
    //     console.log(res);
    //   }
    // );

    await admin.initDataSelectPro(
            "warehouse/warehouse/admin/warehouseProductInventoryType/list",
            {
              limit: 999
            },
            "inventoryTypeId",
            "入库类型名称",
            async (d, obj) => {
              // $("#warehouseProductId").empty();
              form.val("purchaseSignTaskForm", {
                productInventoryType: ""
              });
              if (d.value) {
                form.val("purchaseSignTaskForm", {
                  productInventoryType: obj.name
                });

              }
            },
            "name"
    );

    await admin.initDataSelectPro(
      "warehouse/warehouse/storageRecord/findSign",
      {
        limit: 999
      },
      "userBundleCode",
      "捆包号",
      async (d, obj) => {
        // $("#warehouseProductId").empty();
        form.val("purchaseSignTaskForm", {
          customerName: "",
          signCode: "",
          waybill: "",
          contractCode:'',
          specifications: "",
          productProducer: "",
          productVariety: "",
          productMark: "",
        });
        if (d.value) {
          admin.req(
                  "warehouse/warehouse/storageRecord/findFactoryByUserBundleCode",
                  {
                    userBundleCode: d.value
                  },
                  (res) => {
                    if(res.code==200){
                      form.val("purchaseSignTaskForm", {
                        customerName:res.data.customerName,
                        signCode:res.data.signCode,
                        waybill:res.data.waybill,
                        contractCode:res.data.contractCode,
                        specifications:res.data.specifications,
                        productProducer:res.data.productProducer,
                        productVariety:res.data.productVariety,
                        productMark:res.data.productMark,
                      });
                      formData=res.data

                      getFindByContract(res.data.customerId)
                    }
                  }
          );
          deliveryRecordProductList=[]
          tabValue.reload({
            data: []
          })
        }
      },
      "userBundleCode","userBundleCode"
    );


   async function getFindByContract(id){
      await admin.initDataSelectPro(
              "warehouse/warehouse/admin/administration/findByContract",
              {
                id:id,
                limit: 999
              },
              "warehouseFactoryAdministrationId",
              "入库仓库",
              async (d, obj) => {
                // deliveryRecordProductList=[]
                // tabValue.reload({
                //   data: []
                // })
                warehouseFactoryAdministrationName=obj.name
                warehouseFeatureTypeDesc=obj.warehouseFeatureTypeDesc
                warehouseTypeId=obj.warehouseTypeId
              },
              "name"
      );
    }

    function setTable(productId, signOrderId) {
      admin.req(
        "warehouse/warehouse/admin/administration/selectAll",
        {
          limit: 999,
          productId: productId,
          warehouseSignsOrderId: signOrderId
        },
        (res) => {
          if (res.code == 200) {
            table.reload("warehousePurchaseSignTaskProductTable", { data: res.data[0].warehouseFactoryShelfSpaceVOList });
          }
        }
      );
    }
    var tabValue = table.render({
      elem: "#warehousePurchaseSignTaskProductTable",
      data: [],
      page: false,
      cellMinWidth: 100,
      height: 300,
      cols: [
        [
          { type: "numbers", title: "序号", height: 50 },
          { type: "id", title: "序号", height: 50 ,hide:true},
          {
            field: "code",
            align: "center",
            title: "所属库区",
          },
          {
          field: "warehouseShelfSpaceId",
          title: "入库库位",
            templet: function (d) {
              if (d.codeList) {
                return admin.setTableSelect(
                        "warehouseShelfSpaceId",
                        d.codeList.map((v) => {
                          return {
                            label: v.code,
                            value: v.id
                          };
                        }),
                        false,
                        "warehouseShelfSpaceId"
                )(d);
              } else {
                return "";
              }
            }
        },
          {
            field: "codeNum",
            align: "center",
            title: "该客户捆包数",
          },
          { field: "codeNum", align: "center", title: "在库品种" },
          { field: "codeNum", align: "center", title: "在库钢种/牌号" },

          { align: "center", toolbar: "#PurchaseSignTaskProductTableClick", title: "操作", width: 100 }
        ]
      ],
      done: () => {
        admin.tableSelectChange("warehousePurchaseSignTaskProductTable", "warehouseShelfSpaceId",async (index, value,tableData) => {
          if (value) {
            let kDATA=await admin.reqPro('warehouse/warehouse/admin/administration/findFactoryShelfByShelId', {id:value})
            let obj=null
            if(kDATA.data==null){
              obj={}
            }else{
              obj=kDATA.data
            }
            tableData[index].warehouseShelfId = obj.id;
            tableData[index].columnNum = obj.columnNum;
            tableData[index].layerNum = obj.layerNum;
            tableData[index].warehouseShelfSpaceName = obj.name;
            tableData[index].warehouseAreaId = tableData[index].id;
            table.reload("warehousePurchaseSignTaskProductTable", {
              data: tableData
            });
          } else {
          }
        });
      }
    });

    $("#warehouseStorageRecordFormByAdd .layui-table-body").css("overflow", "visible");
    $("#warehouseStorageRecordFormByAdd .layui-table-box").css("overflow", "visible");
    $("#warehouseStorageRecordFormByAdd .layui-table-view").css("overflow", "visible");
    admin.tableSelectChange("warehousePurchaseSignTaskProductTable", "warehouseAreaId", (index, value, tableData, field) => {
      admin.req(
        "warehouse/warehouse/admin/warehouseFactoryShelfSpace/list",
        {
          warehouseAreaId: value
        },
        (res) => {
          tableData[index].codeList = res.data;
          table.reload("warehousePurchaseSignTaskProductTable", {
            data: tableData
          });

        }
      );
    });
    admin.tableSelectChange("warehousePurchaseSignTaskProductTable", "codeId", (index, value, tableData, field) => {
      // console.log("tableData", tableData);
    });

    table.on("tool(warehousePurchaseSignTaskProductTable)", function (obj) {
      var data = obj.data;
      console.log(obj,"点击入库作业的data")
      let warehouseFactoryShelfSpaceId = data.id;
      let warehouseAreaId = data.warehouseAreaId;

      if (obj.event === "edit") {
        admin.formOpen({
          type: 1,
          area: ["80%", "90%"],
          offset: "10%",
          title: "入库作业",
          path: "components/warehouse/product/warehouseStorageRecordForm.html",
          success: function () {
            const index = $(obj.tr[0]).data("index");
            let parentcont = {
              userBundleCode: $("#userBundleCode").val(),
              specifications: $("#specifications").val(),
              productProducer: $("#productProducer").val(),
              productVariety : $("#productVariety").val(),
              productMark: $("#productMark").val(),
              customerName: $("#customerName").val(),
              grossWeight: formData.grossWeight,
              netWeight : formData.netWeight,
              createTime: formData.createTime,
              warehouseFactoryAdministrationName: warehouseFactoryAdministrationName,
              warehouseFeatureTypeDesc: warehouseFeatureTypeDesc,
              code: data.code,
              warehouseAreaId:warehouseFactoryShelfSpaceId,
              quality:1,
              warehouseShelfSpaceId:data.warehouseShelfSpaceId?data.warehouseShelfSpaceId:'',
              columnNum:data.columnNum?data.columnNum:'',
              layerNum:data.layerNum?data.layerNum:'',
              warehouseShelfSpaceName:data.warehouseShelfSpaceName?data.warehouseShelfSpaceName:'',
            };
            parentData.data = parentcont;
          },
          end: function () {
            console.log(childData.list,table.cache["warehousePurchaseSignTaskProductTable"],"childData.list")
            const index = $(obj.tr[0]).data("index");
            let allList = table.cache["warehousePurchaseSignTaskProductTable"].map((v) => {
              console.log(v,"1222222222")
              // debugger;
              if (v["LAY_TABLE_INDEX"] == index) {

              if (childData.list && childData.list.length > 0&&childData.list[0].warehouseShelfSpaceId!='') {
                v.warehouseShelfSpaceId = childData.list[0].warehouseShelfSpaceId;
                v.inventoryId = formData.inventoryId;
                v.inventoryTypeId=$("#inventoryTypeId").val();
                v.warehouseFactoryAdministrationId=$("#warehouseFactoryAdministrationId").val();
                v.warehouseTypeId=warehouseTypeId;
                v.warehouseAreaId=childData.list[0].warehouseAreaId;
                v.columnNum=childData.list[0].columnNum;
                v.layerNum=childData.list[0].layerNum;
                v.warehouseShelfSpaceName=childData.list[0].warehouseShelfSpaceName;
                v.warehouseShelfId=childData.list[0].warehouseShelfId;
              }
              }
              return v;
            });
            console.log(allList,"allList")
            tabValue.reload({
              data: allList
            })

          }
        });
      }
      if(obj.event === 'delete'){
        deliveryRecordProductList=[]
        tabValue.reload({
          data: []
        })
      }
    });
    $("#addProduct").click(function () {
      if($("#warehouseFactoryAdministrationId").val()==''){
        layer.msg("请选择入库仓库", { icon: 2, time: 1000 });
        return false
      }
      if($("#userBundleCode").val()==''){
        layer.msg("请选择捆包码", { icon: 2, time: 1000 });
        return false
      }
      var purchaseStoragelocation = admin.open({
        type: 1,
        area: ["90%", "85%"],
        offset: ["8%", "8%"],
        title: "入库库位",
        content: $("#purchaseStoragelocation").html(),
        success: async function () {
          let kData = await admin.reqPro("warehouse/warehouse/admin/administration/findFactoryInfo", {id: $("#warehouseFactoryAdministrationId").val()})
          let warehouseFactoryShelfSpaceVOList=kData.data.warehouseFactoryShelfSpaceVOList
          warehouseFactoryShelfSpaceVOList.map(item=>{
            item.codeNum='-'
          })
          form.val("warehouseFormContent", kData.data);

          // 渲染表格
          var insTb = table.render({
            elem: "#purchaseSignTaskProductListTable",
            page: false,
            cellMinWidth: 100,
            limit: 999999,
            // height: 240,
            data: [],
            cols: [
              [
                { type: "radio" },
                { field: "code", align: "center", title: "所属库区" },
                { field: "codeNum", align: "center", title: "库位数", width: 160 },
                { field: "codeNum", align: "center", title: "已使用库位数", width: 160 },
                { field: "codeNum", align: "center", title: "在库品种", width: 160 },
                { field: "codeNum", align: "center", title: "在库钢种/牌号" },
              ]
            ]
          });
          table.reload("purchaseSignTaskProductListTable", {
            data: warehouseFactoryShelfSpaceVOList
          });
          // 确认选择
          $("#confirmChoose").click(async function () {
            var checkStatus = table.checkStatus("purchaseSignTaskProductListTable");
            var dataS = checkStatus.data;

            if (dataS.length == 0) {
              layer.msg("请选择库位", { icon: 2, time: 1000 });
            } else {
              let contL=deliveryRecordProductList.filter(item=>item.id==dataS[0].id)
              if(contL.length){
                layer.msg("该库区已被选择", { icon: 2, time: 1000 });
                return false
              }
              for (var i = 0; i < dataS.length; i++) {
                dataS[i].warehouseShelfSpaceId = '';
              }
              deliveryRecordProductList=dataS;
              layer.close(purchaseStoragelocation);

              const warehouseShelfSpaceIdList = await admin.reqPro('warehouse/warehouse/admin/administration/findFactoryShelfSpaceByWarehouseAreaId', {id:deliveryRecordProductList[0].id,limit: 99999,});
              deliveryRecordProductList[0].codeList = warehouseShelfSpaceIdList.data;
              deliveryRecordProductList[0].inventoryId = formData.inventoryId;
              deliveryRecordProductList[0].warehouseFactoryAdministrationId=$("#warehouseFactoryAdministrationId").val();
              deliveryRecordProductList[0].warehouseTypeId=warehouseTypeId;
              // 获取数据集合并传入表格中
              console.log(deliveryRecordProductList,"deliveryRecordProductList")
              table.reload("warehousePurchaseSignTaskProductTable", {
                data: deliveryRecordProductList,
                limit: deliveryRecordProductList.length
              });
            }
          });
        }
      });


    });
// 监听提交
    form.on("submit(warehouseEntryTaskAdd)", function (d) {
      const formData2 = { ...d.field };
      let list = table.cache["warehousePurchaseSignTaskProductTable"];
      if(list.length===0){
        layer.msg("该添加库区", { icon: 2, time: 1000 });
        return false
      }
      if (list.some(item =>item.warehouseShelfSpaceId === '')) {
        layer.msg("请选择库区内的库位", {icon: 2, time: 1000});
        return false;
      }
      list[0].inventoryTypeId=$("#inventoryTypeId").val();
      let parment={
        warehouseFactoryAdministrationId:formData2.warehouseFactoryAdministrationId,
        warehouseShelfSpaceId:list[0].warehouseShelfSpaceId,
        warehouseOrderId:formData.warehouseOrderId,
        signInRecordId:formData.signInRecordId,
        inventoryQuantity:list.length,
        netWeight:formData.netWeight,
        grossWeight:formData.grossWeight,
        customerId:formData.customerId,
        inventoryTypeId:formData2.inventoryTypeId,
        warehouseTypeId:warehouseTypeId,
        inventoryId:formData.inventoryId
      }
      parment.warehouseProductInventoryVoList=list
      layer.load(2);
      admin.req(
              "warehouse/warehouse/storageRecord/add",
              JSON.stringify(parment),
              function (res) {
                layer.closeAll("loading");
                if (res.code == 200) {
                  layer.msg(res.msg, {icon: 1});
                  table.reload("purchaseSignTaskTable", {});
                  layer.closeAll("page");
                } else {
                  layer.msg(res.msg, {icon: 2});
                }
              },
              "POST",
              false,
              "application/json"
      );
    });
  });
</script>
<style>
  #warehouseStorageRecordFormByAdd .layui-table-cell {
    overflow: visible !important;
  }
  .layui-table-main{
    height: 500px !important;
  }
</style>
